package edu.hcmiu.portal.model;

import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
import com.liferay.portal.kernel.util.HtmlUtil;
import com.liferay.portal.model.impl.BaseModelImpl;

import java.io.Serializable;

import java.lang.reflect.Proxy;


public class user_testClp extends BaseModelImpl<user_test> implements user_test {
    private String _user_id;
    private String _user_name;

    public user_testClp() {
    }

    public String getPrimaryKey() {
        return _user_id;
    }

    public void setPrimaryKey(String pk) {
        setUser_id(pk);
    }

    public Serializable getPrimaryKeyObj() {
        return _user_id;
    }

    public String getUser_id() {
        return _user_id;
    }

    public void setUser_id(String user_id) {
        _user_id = user_id;
    }

    public String getUser_name() {
        return _user_name;
    }

    public void setUser_name(String user_name) {
        _user_name = user_name;
    }

    public user_test toEscapedModel() {
        if (isEscapedModel()) {
            return this;
        } else {
            user_test model = new user_testClp();

            model.setEscapedModel(true);

            model.setUser_id(HtmlUtil.escape(getUser_id()));
            model.setUser_name(HtmlUtil.escape(getUser_name()));

            model = (user_test) Proxy.newProxyInstance(user_test.class.getClassLoader(),
                    new Class[] { user_test.class },
                    new ReadOnlyBeanHandler(model));

            return model;
        }
    }

    public Object clone() {
        user_testClp clone = new user_testClp();

        clone.setUser_id(getUser_id());
        clone.setUser_name(getUser_name());

        return clone;
    }

    public int compareTo(user_test user_test) {
        String pk = user_test.getPrimaryKey();

        return getPrimaryKey().compareTo(pk);
    }

    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }

        user_testClp user_test = null;

        try {
            user_test = (user_testClp) obj;
        } catch (ClassCastException cce) {
            return false;
        }

        String pk = user_test.getPrimaryKey();

        if (getPrimaryKey().equals(pk)) {
            return true;
        } else {
            return false;
        }
    }

    public int hashCode() {
        return getPrimaryKey().hashCode();
    }

    public String toString() {
        StringBuilder sb = new StringBuilder();

        sb.append("{user_id=");
        sb.append(getUser_id());
        sb.append(", user_name=");
        sb.append(getUser_name());
        sb.append("}");

        return sb.toString();
    }

    public String toXmlString() {
        StringBuilder sb = new StringBuilder();

        sb.append("<model><model-name>");
        sb.append("edu.hcmiu.portal.model.user_test");
        sb.append("</model-name>");

        sb.append(
            "<column><column-name>user_id</column-name><column-value><![CDATA[");
        sb.append(getUser_id());
        sb.append("]]></column-value></column>");
        sb.append(
            "<column><column-name>user_name</column-name><column-value><![CDATA[");
        sb.append(getUser_name());
        sb.append("]]></column-value></column>");

        sb.append("</model>");

        return sb.toString();
    }
}
